﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
/// Summary description for ConnectionPool
/// </summary>
public class ConnectionPool
{
	public ConnectionPool()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public static System.Data.SqlClient.SqlConnection getConnection()
    {
        System.Data.SqlClient.SqlConnection con = null;
        try
        {
            string str = System.Configuration.ConfigurationManager.ConnectionStrings["constring"].ConnectionString;
            con = new System.Data.SqlClient.SqlConnection(str);
        }
        catch (System.Data.SqlClient.SqlException ex)
        {
            con = null;
            throw new Exception(ex.Message);
        }
        return con;
    }
}
